<?php
/**
 * Plugin Name: Kader
 * Plugin URI: 	http://apartmedia.de
 * Description: A Plugin to create a custom post type
 * Version: 	1.0
 * Author: 		Jan Zaydowicz
 * Author URI: 	http://apartmedia.de
 * License: 	GPLv2 or later
 * Text Domain: kader
 * Domain Path: /language
 */



if ( ! class_exists( 'Kader' ) ) {

	if ( function_exists( 'add_filter' ) )
		add_filter( 'plugins_loaded' ,  array( 'Kader', 'get_instance' ) );

	class Kader {
		
			
		/**
		 * Instance holder
		 *
		 * @var		NULL | __CLASS__
		 */
		private static $instance = NULL;
		
		/**
		 * Method for ensuring that only one instance of this object is used
		 *
		 * @return	__CLASS__
		 */
		public static function get_instance() {
				
			if ( ! self::$instance )
				self::$instance = new self;
			return self::$instance;
		}
		
		/**
		 * Setting up some data, initialize localization and load
		 * the features
		 *
		 * @return	void
		 */
		public function __construct () {
				
			// Translation
			load_plugin_textdomain( 'kader', FALSE, dirname( plugin_basename( __FILE__ ) ) . '/language' );
				
			// Load the features
			$this->load_features();
			
		}
		
		/**
		 * Returns array of features, also
		 * Scans the plugins subfolder "/features"
		 *
		 * @return	void
		 */
		protected function load_features() {
				
			// load all files with the pattern class-*.php from the directory inc
			foreach ( glob( dirname( __FILE__ ) . '/inc/class-*.php' ) as $class )
				require_once $class;
		}
	}
}	